import { defineComponent } from "vue";
import style from "./index.module.less";
import Text from "../Text";
import RowView from "../RowView";
import TextGroups from "../TextGroups";
import { ITextGroupPropsData } from "../TextGroups/types";
import IconText from "../IconText";
import ButtonView from "../ButtonView";
import { Divider } from "vant";
import { phoneClick } from "@/command/apiTool";
export default defineComponent({
  name: "",
  props: {
    itemData: {
      type: Object as any,
      default: () => {
        return {};
      },
    },
  },
  setup(_) {
    return () => {
      const data: ITextGroupPropsData[] = [
        {
          name: "包装类型",
          value: _.itemData.packTypeName,
        },
        {
          name: "申请数量",
          value: _.itemData.applyNum,
        },
      ];
      return (
        <div class="flex flex-col">
          <Text>日期：{_.itemData.date}</Text>
          <TextGroups
            data={data}
            childClass="text-[#333] text-[14px]"
            class="my-[10px]"
          />
          <RowView class="justify-between">
            <IconText url={_.itemData.logoUrl} text={_.itemData.userName} />
            <ButtonView
              class="!h-[32px]"
              onClick={() => phoneClick(_.itemData.phone)}
            >
              联系大户
            </ButtonView>
          </RowView>
          <Divider />
        </div>
      );
    };
  },
});
